<?php

namespace app\cms\model;

use think\admin\Model;

class StockLogs extends Model
{
  // 操作类型获取器
  public function getTypeNameAttr()
  {
    return $this->type ? '入库' : '出库';
  }

  // 关联商品
  public function goods()
  {
    return $this->belongsTo(StockGoods::class, 'goods_id');
  }
}